import Vue from "vue";
import axios from "axios";
import {sync} from "vuex-router-sync";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import axiosConfig from "./config/axiosConfig";
import * as filters from "./filters";
import MintUI from "mint-ui";
import ElementUI from "element-ui";
import "element-ui/lib/theme-default/index.css";
import "mint-ui/lib/style.css";
import "font-awesome/css/font-awesome.css";
import "components/widget/index";
import "structure/Map";
import Func from "structure/Func";

Vue.prototype.$http = axios.create(axiosConfig);
Vue.axios = axios;
Vue.use(ElementUI);
Vue.use(MintUI);
Vue.prototype.$func = Func;

// Enable devtools
Vue.config.devtools = true;

sync(store, router);

const {state} = store;

Object.keys(filters).forEach(key => {
    Vue.filter(key, filters[key]);
});

const app = new Vue({
    router,
    store,
    ...App
});

export {app, router, store}
